package com.caigou.bean.cms.param;

import com.caigou.util.DateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
@ApiModel(description = "查询用户参数")
public class UsersParam {


    @ApiModelProperty(value = "用户注册手机号", name = "tel", required = true, example = "18310013577")
    private String tel;

    private String userId;
//
//    private String nickName;

    private String queryText;//查询文本：用户ID或者手机号码或者昵称

    private String startTime;

    private String endTime;

    private Integer userSource;//用户来源，1政府采购信息网；2易采通app；3易考通；4易找标；5采橙优选


    private String[] labels;//个人兴趣标签

    private int[] areaLabels;//地域标签，市级

    private Integer yctVip;//0非易采通vip用户，1易采通vip用户

    private Integer fromUserLevel;//用户等级（从）

    private Integer toUserLevel;//用户等级（到）

    private Integer fromIntegral;//用户积分（从）

    private Integer toIntegral;//用户积分（到）

    private Integer userStatus;//用户状态，0冻结；1正常；2禁言

    private Long startTimestamp;

    public Long getStartTimestamp(){
        if(startTime!=null){
            Date date = DateUtil.stringtoDate(startTime+" 00:00:00", "yyyy-MM-dd HH:mm:ss");
            if(date==null){
                return null;
            }
            startTimestamp = date.getTime()/1000;
            return startTimestamp;
        }else{
            return null;
        }
    }

    private Long endTimestamp;

    public Long getEndTimestamp(){
        if(endTime!=null){
            Date date = DateUtil.stringtoDate(endTime+" 23:59:59", "yyyy-MM-dd HH:mm:ss");
            if(date==null){
                return null;
            }
            endTimestamp = date.getTime()/1000;
            return endTimestamp;
        }else{
            return null;
        }
    }

    private List<String> userIdListByLabels;//通过属性获取的用户id列表


    @ApiModelProperty(value = "分页页数", name = "page", required = true, example = "1")
    private Integer page = 1;
    @ApiModelProperty(value = "分页条数", name = "size", required = true, example = "10")
    private Integer size = 10;

}
